package cn.wangqi.personal.service.impl;

import cn.wangqi.personal.dao.MajorDao;
import cn.wangqi.personal.domain.Major;
import cn.wangqi.personal.service.IMajorService;
import cn.wangqi.personal.util.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by admin on 2017/9/12.
 */
@Service
public class MajorService implements IMajorService{

    @Resource
    public MajorDao majorDao;

    @Override
    public List<Major> listMajor(Integer collageId, Page page) {
        return majorDao.listMajor(collageId,page);
    }

    @Override
    public int countMajor(Integer collageId) {
        return majorDao.countMajor(collageId);
    }

    @Override
    public void saveMajor(Major major) {
        majorDao.saveMajor(major);
    }

    @Override
    public void deleteMajorById(int majorId) {
        majorDao.deleteMajorById(majorId);
    }

    @Override
    public Major findMajorById(int majorId) {
        return majorDao.findMajorById(majorId);
    }

    @Override
    public void updateMajor(Major major) {
        majorDao.updateMajor(major);
    }

}
